using B.S.NewMedical.Api.Read.Application.Command.Doctor.Checkup;
using B.S.NewMedical.Api.Read.DTOS.Checkup;
using B.S.NewMedical.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace B.S.NewMedical.Api.Read.Controllers.Doctor
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class CheckupController : ControllerBase
    {
        private readonly IMediator _mediator;

        public CheckupController(IMediator mediator)
        {
            _mediator = mediator;
        }

        /// <summary>
        /// 获取检查项目列表
        /// </summary>
        /// <param name="categoryId">检查项目分类ID，可选</param>
        /// <returns>检查项目列表</returns>
        [HttpGet]
        public async Task<ApiResult<List<CheckupItemDto>>> GetCheckupItems([FromQuery] int? categoryId = null)
        {
            return await _mediator.Send(new GetCheckupItemsCommand(categoryId));
        }
    }
}